from functools import reduce

def str2int(str):
	strEqInt = dict(zip("0123456789", range(10)))
	def char2int(ch):
		return strEqInt[ch];
	def fn(x, y):
		return x * 10 + y
	
	return reduce(fn, map(char2int, str))
	
print(str2int("12386"))